{extend name="./template/default/m/pub/base.html" /}
{block name="seo"}
<title>用户充值-{$site_name}</title>
{/block}
{block name="content"}
{include file="./template/default/m/pub/top3.html" /}
<div style="margin-top:60px;">
    <div class="title-1">充值金额</div>
    <ul class="recharge-selector">
        {volist name="moneys" id="vo"}
        <li>
            <a href="javascript:void(0);" data-val="{$vo}">
                <p class="recharge-selector-title">{$vo}元</p>
                <p class="recharge-selector-main"> <span>￥</span>{$vo} </p>
            </a>
        </li>
        {/volist}
    </ul>
    <div class="title-1">充值方式</div>
    <ul class="recharge-style">
        {volist name="payments" id="vo"}
        <li data-code="{$vo.code}">
            <img class="recharge-style-img" src="/static/images/{$vo.img}.png">
            <div class="recharge-style-info">
                <p class="recharge-style-title">{$vo.title}</p>
            </div>
            <img class="recharge-style-right" src="/static/images/recharge-style-right.png">
        </li>
        {/volist}
        <li>
            <img class="recharge-style-img" src="/static/images/kami.png">
            <div class="recharge-style-info" onclick="location.href = '/kami'">
                <p class="recharge-style-title">购买卡密</p>
            </div>
            <img class="recharge-style-right" src="/static/images/recharge-style-right.png">
        </li>
    </ul>
    <form method="post" id="chargeForm" action="charge">
        <input type="hidden" name="money" id="money" value="">
        <input type="hidden" name="code" id="code">
        <input type="hidden" name="pay_type"  value="1">
    </form>
    <div class="recharge-tip">
        <p class="recharge-tip-line">温馨提示：</p>
        <p class="recharge-tip-line">1、成为本站vip，可以免费阅读所有收费章节，不再有额外消费</p>
        <p class="recharge-tip-line">2、充值遇到问题？请联系客服QQ3431341492</p>
        <p class="recharge-tip-bottom">
            <a href="#">《用户充值、消费服务协》</a>
        </p>
    </div>
    <div class="mask" style="display: none;"></div>
</div>
<a class="recharge-fix-btn" href="javascript:void(0);" id="formSub">确认充值</a>
<div class="toast" style="display:none;"></div>
<script>
    $('.recharge-selector li a').click(function () {
        $(this).addClass('active').parent().siblings().find('a').removeClass('active');
        $('#money').val($(this).attr('data-val'));
    })
    $('.recharge-style li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $('#code').val($(this).attr('data-code'));
    })

    $('#formSub').click(function () {
        var money=$('#money').val();
        if (money == '' || money == undefined){
            ShowDialog('请选择支付金额和支付方式');
        }else {
            $('#chargeForm')[0].submit(function (event) {
                console.log(event);
            });
        }
    })
</script>
{/block}